package dk.dashboardFP.panels.displayPanel.core {
	import dk.dashboardFP.panels.displayPanel.SelectionMark;

	import flash.display.DisplayObject;
	import flash.events.EventDispatcher;

	/**
	 * @author josef
	 */
	public class EditorItem extends EventDispatcher {
		private var _doTarget : DisplayObject;
		private var _doSelectionMark : SelectionMark;
		private var _originalPosX : Number;
		private var _originalPosY : Number;

		public function EditorItem(doTarget : DisplayObject) {
			
			
			_doTarget = doTarget;
			super();
			
			setupElements();
			
			_originalPosX = this.doTarget.x;
			_originalPosY = this.doTarget.y;
		}

		//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
		// setup
		//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

		private function setupElements() : void {
		}
		
		//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
		// messurements
		//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
		
		public function showMessurements(pointTarget : DisplayObject) : void {
			_doSelectionMark.showMessurements(pointTarget);
		}

		//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
		// register mark
		//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::Mark

		public function registerSelection(doSelectionMark : SelectionMark) : void {
			_doSelectionMark = doSelectionMark;
		}

		public function unRegisterSelectionMark() : void {
			_doSelectionMark = null;
		}

		//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
		// helpers
		//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

		public function get doTarget() : DisplayObject {
			return _doTarget;
		}

		public function get doSelectionMark() : SelectionMark {
			return _doSelectionMark;
		}
		
		public function get originalPosX() : Number {
			return _originalPosX;
		}
		
		public function get originalPosY() : Number {
			return _originalPosY;
		}
	}
}
